<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <link rel="stylesheet" href="./style.css">
    <style>
        .mid-home{
            width: 700px;
            margin:0 auto;
            text-align: center;
            margin-top: 400px;
        }
        h2{
            font-size: 40px;
            margin-top: 30px;
            color: red;
        }
        #showGame{
            width: 300px;
            margin: 0 auto;
            display: none;
            font-size: 40px;
        }
    </style>
</head>
<body>
    <div class="mid-home">
        <h2 onclick="starGame()">开始游戏!</h2>
        <h2 onclick="lookGame()">怎么玩!</h2>
        <h2 id="downCode"> <a href="./game.7z">下载代码!</a> </h2>
        <div id="showGame">
            使用键盘控制，上下左右，吃完所有金币即为通关！
        </div>
    </div>
</body>
<script>
    function starGame(){
        window.location = "index.html"
    }
    function lookGame(){
        let downCode = document.getElementById("downCode")
        downCode.style.display = "none"
        let showGame  =document.getElementById("showGame")
        showGame.style.display = "block"
    }
</script>
</html>